home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / var / lib / dpkg / info / python-configglue.prerm < prev    next >
Text File  |  2009-06-24  |  1KB  |  48 lines

  1. #!/bin/sh
  2. set -e
  3. # Automatically added by dh_pycentral
  4. case "$1" in remove|upgrade)
  5.     pkgremove=y
  6. esac
  7. if [ -f /var/lib/pycentral/python-configglue.pkgremove ] || [ -f /var/lib/pycentral/pkgremove ]; then
  8.     pkgremove=y
  9. fi
  10. if [ "$pkgremove" = y ]; then
  11. if which python >/dev/null 2>&1 && which pycentral >/dev/null 2>&1; then
  12.     pycentral pkgremove python-configglue
  13. else
  14.     flist=$(tempfile)
  15.     slist=$(tempfile)
  16.     dpkg -L python-configglue | tee $flist | \
  17.     while read n; do
  18.       case "$n" in
  19.         /usr/share/pyshared/*)
  20.           n2=${n#/usr/share/pyshared/*}
  21.           case "$n" in
  22.         *.py) echo "p $n";;
  23.         *) [ -d "$n" ] && echo "d $n2" || echo "f $n2"
  24.           esac
  25.           ;;
  26.         *) continue
  27.       esac
  28.     done > $slist
  29.     if [ -s $slist ]; then
  30.         for d in /usr/lib/python[0-9].[0-9]/????-packages; do
  31.         case "$d" in */python2.1/*|*/python2.2/*) continue; esac
  32.         while read t n; do
  33.             case "$t" in
  34.             p) rm -f $d/$n $d/${n}[co];;
  35.             d) rmdir $d/$n 2>/dev/null || true;;
  36.             *) rm -f $d/$n
  37.             esac
  38.         done < $slist
  39.         done
  40.     fi
  41.         awk '/\/usr\/share\/pyshared/ {next} /\.py$/ {print $0"c\n" $0"o"}' $flist \
  42.         | xargs -r rm -f >&2
  43.     rm -f $flist $slist
  44. fi
  45. rm -f /var/lib/pycentral/python-configglue.pkgremove
  46. fi
  47. # End automatically added section
  48.